Change GtkIconSize to int in params/return values
authorDan Winship <danw@gnome.org>
Fri, 18 Dec 2009 10:58:36 +0000 (11:58 +0100)
committerDan Winship <danw@gnome.org>
Sat, 19 Dec 2009 09:32:35 +0000 (10:32 +0100)
GtkIconSize is an extensible enumeration (via
gtk_icon_size_register()), so methods that claim to take/return a
GtkIconSize need to actually use "int" to work correctly with bindings
that are strict about enum values.

https://bugzilla.gnome.org/show_bug.cgi?id=604895

gtk/gtkaction.c
gtk/gtkiconfactory.c
gtk/gtkimage.c
gtk/gtkscalebutton.c
gtk/gtkstyle.c
gtk/gtktoolbar.c
gtk/gtktoolitem.c
gtk/gtktoolpalette.c
gtk/gtktoolshell.c
gtk/gtktooltip.c
gtk/gtkwidget.c

index 48417a2bfcd5748cfa29f4cd73a2ef3c412d2e1e..40cf10f15a393541f71f01d902c0a54c67ca97bc 100644 (file)
@@ -825,7 +825,7 @@ gtk_action_unblock_activate (GtkAction *action)
 /**
  * gtk_action_create_icon:
  * @action: the action object
- * @icon_size: the size of the icon that should be created.
+ * @icon_size: (type int): the size of the icon that should be created.
  *
  * This function is intended for use by action implementations to
  * create icons displayed in the proxy widgets.
index 906a757656de37e15a174737cc33a5bcd78b7185..a9754e4e22dc2db83ef1e11fb676111fd4c9e06a 100644 (file)
@@ -899,7 +899,7 @@ icon_size_lookup_intern (GtkSettings *settings,
  * gtk_icon_size_lookup_for_settings:
  * @settings: a #GtkSettings object, used to determine
  *   which set of user preferences to used.
- * @size: an icon size
+ * @size: (type int): an icon size
  * @width: location to store icon width
  * @height: location to store icon height
  *
@@ -931,7 +931,7 @@ gtk_icon_size_lookup_for_settings (GtkSettings *settings,
 
 /**
  * gtk_icon_size_lookup:
- * @size: an icon size
+ * @size: (type int): an icon size
  * @width: location to store icon width
  * @height: location to store icon height
  *
@@ -1014,7 +1014,7 @@ icon_size_register_intern (const gchar *name,
  * Registers a new icon size, along the same lines as #GTK_ICON_SIZE_MENU,
  * etc. Returns the integer value for the size.
  *
- * Returns: integer value representing the size
+ * Returns: (type int): integer value representing the size
  */
 GtkIconSize
 gtk_icon_size_register (const gchar *name,
@@ -1031,7 +1031,7 @@ gtk_icon_size_register (const gchar *name,
 /**
  * gtk_icon_size_register_alias:
  * @alias: an alias for @target
- * @target: an existing icon size
+ * @target: (type int): an existing icon size
  *
  * Registers @alias as another name for @target.
  * So calling gtk_icon_size_from_name() with @alias as argument
@@ -1078,6 +1078,8 @@ gtk_icon_size_register_alias (const gchar *alias,
  * @returns: the icon size with the given name.
  *
  * Looks up the icon size associated with @name.
+ *
+ * Return value: (type int): the icon size
  */
 GtkIconSize
 gtk_icon_size_from_name (const gchar *name)
@@ -1096,7 +1098,7 @@ gtk_icon_size_from_name (const gchar *name)
 
 /**
  * gtk_icon_size_get_name:
- * @size: a #GtkIconSize.
+ * @size: (type int): a #GtkIconSize.
  * @returns: the name of the given icon size.
  *
  * Gets the canonical name of the given icon size. The returned string
@@ -1623,7 +1625,7 @@ render_fallback_image (GtkStyle          *style,
  * @style: (allow-none): a #GtkStyle associated with @widget, or %NULL
  * @direction: text direction
  * @state: widget state
- * @size: icon size. A size of (GtkIconSize)-1
+ * @size: (type int): icon size. A size of (GtkIconSize)-1
  *        means render at the size of the source and don't scale.
  * @widget: widget that will display the icon, or %NULL.
  *          The only use that is typically made of this
@@ -1762,7 +1764,8 @@ gtk_icon_set_add_source (GtkIconSet          *icon_set,
 /**
  * gtk_icon_set_get_sizes:
  * @icon_set: a #GtkIconSet
- * @sizes: (array length=n_sizes) (out): return location for array of sizes
+ * @sizes: (array length=n_sizes) (out) (type int): return location
+ *     for array of sizes
  * @n_sizes: location to store number of elements in returned array
  *
  * Obtains a list of icon sizes this icon set can render. The returned
@@ -2331,7 +2334,7 @@ gtk_icon_source_set_state (GtkIconSource *source,
 /**
  * gtk_icon_source_set_size:
  * @source: a #GtkIconSource
- * @size: icon size this source applies to
+ * @size: (type int): icon size this source applies to
  *
  * Sets the icon size this icon source is intended to be used
  * with.
@@ -2393,7 +2396,7 @@ gtk_icon_source_get_state (const GtkIconSource *source)
  * Obtains the icon size this source applies to. The return value
  * is only useful/meaningful if the icon size is <emphasis>not</emphasis> wildcarded.
  *
- * Return value: icon size this source matches.
+ * Return value: (type int): icon size this source matches.
  */
 GtkIconSize
 gtk_icon_source_get_size (const GtkIconSource *source)
index 7e1e23e4e565ae080145e9f50ed829250e50e6a0..01e293f0e8d3044ee5e3eb351c5256b435b878d7 100644 (file)
@@ -607,7 +607,7 @@ gtk_image_new_from_pixbuf (GdkPixbuf *pixbuf)
 /**
  * gtk_image_new_from_stock:
  * @stock_id: a stock icon name
- * @size: a stock icon size
+ * @size: (type int): a stock icon size
  * 
  * Creates a #GtkImage displaying a stock icon. Sample stock icon
  * names are #GTK_STOCK_OPEN, #GTK_STOCK_QUIT. Sample stock sizes
@@ -634,7 +634,7 @@ gtk_image_new_from_stock (const gchar    *stock_id,
 /**
  * gtk_image_new_from_icon_set:
  * @icon_set: a #GtkIconSet
- * @size: a stock icon size
+ * @size: (type int): a stock icon size
  *
  * Creates a #GtkImage displaying an icon set. Sample stock sizes are
  * #GTK_ICON_SIZE_MENU, #GTK_ICON_SIZE_SMALL_TOOLBAR. Instead of using
@@ -696,7 +696,7 @@ gtk_image_new_from_animation (GdkPixbufAnimation *animation)
 /**
  * gtk_image_new_from_icon_name:
  * @icon_name: an icon name
- * @size: a stock icon size
+ * @size: (type int): a stock icon size
  * 
  * Creates a #GtkImage displaying an icon from the current icon theme.
  * If the icon name isn't known, a "broken image" icon will be
@@ -723,7 +723,7 @@ gtk_image_new_from_icon_name (const gchar    *icon_name,
 /**
  * gtk_image_new_from_gicon:
  * @icon: an icon
- * @size: a stock icon size
+ * @size: (type int): a stock icon size
  * 
  * Creates a #GtkImage displaying an icon from the current icon theme.
  * If the icon name isn't known, a "broken image" icon will be
@@ -947,7 +947,7 @@ gtk_image_set_from_pixbuf (GtkImage  *image,
  * gtk_image_set_from_stock:
  * @image: a #GtkImage
  * @stock_id: a stock icon name
- * @size: a stock icon size
+ * @size: (type int): a stock icon size
  *
  * See gtk_image_new_from_stock() for details.
  **/
@@ -990,7 +990,7 @@ gtk_image_set_from_stock  (GtkImage       *image,
  * gtk_image_set_from_icon_set:
  * @image: a #GtkImage
  * @icon_set: a #GtkIconSet
- * @size: a stock icon size
+ * @size: (type int): a stock icon size
  *
  * See gtk_image_new_from_icon_set() for details.
  **/
@@ -1071,7 +1071,7 @@ gtk_image_set_from_animation (GtkImage           *image,
  * gtk_image_set_from_icon_name:
  * @image: a #GtkImage
  * @icon_name: an icon name
- * @size: an icon size
+ * @size: (type int): an icon size
  *
  * See gtk_image_new_from_icon_name() for details.
  * 
@@ -1116,7 +1116,7 @@ gtk_image_set_from_icon_name  (GtkImage       *image,
  * gtk_image_set_from_gicon:
  * @image: a #GtkImage
  * @icon: an icon
- * @size: an icon size
+ * @size: (type int): an icon size
  *
  * See gtk_image_new_from_gicon() for details.
  * 
@@ -1265,7 +1265,8 @@ gtk_image_get_pixbuf (GtkImage *image)
  * @image: a #GtkImage
  * @stock_id: (out) (transfer none) (allow-none): place to store a
  *     stock icon name, or %NULL
- * @size: (out) (allow-none): place to store a stock icon size, or %NULL
+ * @size: (out) (allow-none) (type int): place to store a stock icon
+ *     size, or %NULL
  *
  * Gets the stock icon name and size being displayed by the #GtkImage.
  * The storage type of the image must be %GTK_IMAGE_EMPTY or
@@ -1297,7 +1298,8 @@ gtk_image_get_stock  (GtkImage        *image,
  * @image: a #GtkImage
  * @icon_set: (out) (transfer none) (allow-none): location to store a
  *     #GtkIconSet, or %NULL
- * @size: (out) (allow-none): location to store a stock icon size, or %NULL
+ * @size: (out) (allow-none) (type int): location to store a stock
+ *     icon size, or %NULL
  *
  * Gets the icon set and size being displayed by the #GtkImage.
  * The storage type of the image must be %GTK_IMAGE_EMPTY or
@@ -1351,7 +1353,8 @@ gtk_image_get_animation (GtkImage *image)
  * @image: a #GtkImage
  * @icon_name: (out) (transfer none) (allow-none): place to store an
  *     icon name, or %NULL
- * @size: (out) (allow-none): place to store an icon size, or %NULL
+ * @size: (out) (allow-none) (type int): place to store an icon size,
+ *     or %NULL
  *
  * Gets the icon name and size being displayed by the #GtkImage.
  * The storage type of the image must be %GTK_IMAGE_EMPTY or
@@ -1385,7 +1388,8 @@ gtk_image_get_icon_name  (GtkImage              *image,
  * @image: a #GtkImage
  * @gicon: (out) (transfer none) (allow-none): place to store a
  *     #GIcon, or %NULL
- * @size: (out) (allow-none): place to store an icon size, or %NULL
+ * @size: (out) (allow-none) (type int): place to store an icon size,
+ *     or %NULL
  *
  * Gets the #GIcon and size being displayed by the #GtkImage.
  * The storage type of the image must be %GTK_IMAGE_EMPTY or
index e15956042372394278340df3b7098382d260055c..f61ee9a465979d283573e9f55bb470b61cdab1fd 100644 (file)
@@ -541,7 +541,7 @@ gtk_scale_button_dispose (GObject *object)
 
 /**
  * gtk_scale_button_new:
- * @size: a stock icon size
+ * @size: (int): a stock icon size
  * @min: the minimum value of the scale (usually 0)
  * @max: the maximum value of the scale (usually 100)
  * @step: the stepping of value when a scroll-wheel event,
index 70b05c1c23f8a411668afaa8cbd7769f504584ff..3e5001be1735b0849feadcd8d76ffc0ee352d119 100644 (file)
@@ -2167,8 +2167,9 @@ gtk_style_real_set_background (GtkStyle    *style,
  * @source: the #GtkIconSource specifying the icon to render
  * @direction: a text direction
  * @state: a state
- * @size: the size to render the icon at. A size of (GtkIconSize)-1
- *        means render at the size of the source and don't scale.
+ * @size: (type int) the size to render the icon at. A size of
+ *     (GtkIconSize)-1 means render at the size of the source and
+ *     don't scale.
  * @widget: (allow-none): the widget
  * @detail: (allow-none): a style detail
  * @returns: a newly-created #GdkPixbuf containing the rendered icon
index b83790ccaccbdca1339b1fc99bd4eeb8aae939d7..f383ff539f2dd0bfa7f52928bb2ac237e3647571 100644 (file)
@@ -3037,7 +3037,8 @@ gtk_toolbar_get_nth_item (GtkToolbar *toolbar,
  *
  * Retrieves the icon size for the toolbar. See gtk_toolbar_set_icon_size().
  *
- * Return value: the current icon size for the icons on the toolbar.
+ * Return value: (type int): the current icon size for the icons on
+ * the toolbar.
  **/
 GtkIconSize
 gtk_toolbar_get_icon_size (GtkToolbar *toolbar)
@@ -3194,7 +3195,8 @@ gtk_toolbar_finalize (GObject *object)
 /**
  * gtk_toolbar_set_icon_size:
  * @toolbar: A #GtkToolbar
- * @icon_size: The #GtkIconSize that stock icons in the toolbar shall have.
+ * @icon_size: (type int): The #GtkIconSize that stock icons in the
+ *     toolbar shall have.
  *
  * This function sets the size of stock icons in the toolbar. You
  * can call it both before you add the icons and after they've been
index 1cae42908f9a4246a40035ee9a6ae3f4483d2ef2..2d18d4e823d90dca12e6bf9ff27cf84aa9cccc4d 100644 (file)
@@ -738,7 +738,8 @@ gtk_tool_item_get_ellipsize_mode (GtkToolItem *tool_item)
  * #GtkToolItem should call this function to find out what size icons
  * they should use.
  * 
- * Return value: a #GtkIconSize indicating the icon size used for @tool_item
+ * Return value: (type int): a #GtkIconSize indicating the icon size
+ * used for @tool_item
  * 
  * Since: 2.4
  **/
index 9d7bc28f4c4ef5a8d2ea73f780c5f0152789f4fe..5c38781f388d5f42e4ea90ecfe5142d7f4a31206 100644 (file)
@@ -1074,7 +1074,8 @@ gtk_tool_palette_new (void)
 /**
  * gtk_tool_palette_set_icon_size:
  * @palette: a #GtkToolPalette
- * @icon_size: the #GtkIconSize that icons in the tool palette shall have
+ * @icon_size: (type int): the #GtkIconSize that icons in the tool
+ *     palette shall have
  *
  * Sets the size of icons in the tool palette.
  *
@@ -1240,7 +1241,7 @@ gtk_tool_palette_unset_style (GtkToolPalette *palette)
  * Gets the size of icons in the tool palette.
  * See gtk_tool_palette_set_icon_size().
  *
- * Returns: the #GtkIconSize of icons in the tool palette
+ * Returns: (type int): the #GtkIconSize of icons in the tool palette
  *
  * Since: 2.20
  */
index 92560e57a66f34f15d20414461fed2a643a9decf..ac7b84e5697b578bab298230e96e1c5903899057 100644 (file)
@@ -66,7 +66,7 @@ gtk_tool_shell_get_type (void)
  * Retrieves the icon size for the tool shell. Tool items must not call this
  * function directly, but rely on gtk_tool_item_get_icon_size() instead.
  *
- * Return value: the current size for icons of @shell
+ * Return value: (type int): the current size for icons of @shell
  *
  * Since: 2.14
  **/
index 8ccd363e013419920f270e5d1e989588349df4e8..61d71ba5035cb6f33a6904cc92a901c3ab540371 100644 (file)
@@ -282,7 +282,7 @@ gtk_tooltip_set_icon (GtkTooltip *tooltip,
  * gtk_tooltip_set_icon_from_stock:
  * @tooltip: a #GtkTooltip
  * @stock_id: a stock id, or %NULL
- * @size: a stock icon size
+ * @size: (type int): a stock icon size
  *
  * Sets the icon of the tooltip (which is in front of the text) to be
  * the stock item indicated by @stock_id with the size indicated
@@ -309,7 +309,7 @@ gtk_tooltip_set_icon_from_stock (GtkTooltip  *tooltip,
  * gtk_tooltip_set_icon_from_icon_name:
  * @tooltip: a #GtkTooltip
  * @icon_name: an icon name, or %NULL
- * @size: a stock icon size
+ * @size: (type int): a stock icon size
  *
  * Sets the icon of the tooltip (which is in front of the text) to be
  * the icon indicated by @icon_name with the size indicated
@@ -336,7 +336,7 @@ gtk_tooltip_set_icon_from_icon_name (GtkTooltip  *tooltip,
  * gtk_tooltip_set_icon_from_gicon:
  * @tooltip: a #GtkTooltip
  * @gicon: a #GIcon representing the icon, or %NULL
- * @size: a stock icon size
+ * @size: (type int): a stock icon size
  *
  * Sets the icon of the tooltip (which is in front of the text)
  * to be the icon indicated by @gicon with the size indicated
index cf1d3610d946e4cf316561b3c01c4070f5f81668..c9a9b59fcffab6ca85014ce4a1b01f2a6dc5369f 100644 (file)
@@ -7159,9 +7159,9 @@ gtk_widget_create_pango_layout (GtkWidget   *widget,
  * gtk_widget_render_icon:
  * @widget: a #GtkWidget
  * @stock_id: a stock ID
- * @size: a stock size. A size of (GtkIconSize)-1 means render at 
- *     the size of the source and don't scale (if there are multiple
- *     source sizes, GTK+ picks one of the available sizes).
+ * @size: (type int) a stock size. A size of (GtkIconSize)-1 means
+ *     render at the size of the source and don't scale (if there are
+ *     multiple source sizes, GTK+ picks one of the available sizes).
  * @detail: (allow-none): render detail to pass to theme engine
  *
  * A convenience function that uses the theme engine and RC file